# Maintainer: Sven-Hendrik Haase <svenstaro@archlinux.org>
# Contributor: Sandy Carter <bwrsandman@gmail.com>

pkgname=openmw
pkgver=0.48.0
pkgrel=4
pkgdesc="Open-source engine reimplementation for the role-playing game Morrowind"
arch=('loong64' 'x86_64')
url="http://www.openmw.org"
license=('GPL3' 'MIT' 'custom')
depends=('openal' 'openscenegraph' 'mygui' 'qt5-base' 'ffmpeg' 'sdl2' 'unshield'
         'libxt' 'boost-libs' 'bullet-dp' 'yaml-cpp' 'luajit')
makedepends=('cmake' 'boost' 'doxygen' 'ninja')
source=("https://github.com/OpenMW/openmw/archive/refs/tags/openmw-${pkgver}.tar.gz")
sha512sums=('6f2429253b44a232fc69db7f04a873f7328a5e95d810c36768311bdc23064a96c9963caa7d64a906bd67509e3a2f8d142db005ce093fc2764dd672ae6a617414')

build() {
  cd openmw-openmw-$pkgver

  cmake \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DCMAKE_BUILD_TYPE=Release \
    -DOPENMW_LTO_BUILD=ON \
    -DDESIRED_QT_VERSION=5 \
    -GNinja \
    -Bbuild
  ninja -C build
}

package() {
  cd openmw-openmw-$pkgver
  DESTDIR="$pkgdir" ninja -C build install
}

# vim: ts=2 sw=2 et:
